import * as API from '../utils/api'

export const LOAD_SHORT_RENT_LIST = 'LOAD_SHORT_RENT_LIST'
export const UPDATE_SHORT_RENT_LIST = 'UPDATE_SHORT_RENT_LIST'

export const loadShortRentList = ({page = 1}) => dispatch => 
    ( 
        API.fetchShortRentList({page})
        .then(json => dispatch(updateShortRentList({...json})))
    )


export const updateShortRentList = list => ({
    type: UPDATE_SHORT_RENT_LIST,
    list
})